class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.s: E = None
        self.x: E = None
        self.q: E = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

j = A("j")
n = B("n")
i = C("i")
h = D("h")
k = E("k")
c = F("c")
m = D("m")
d = B("d")
f = A("f")

j.w = m
j.t = i
j.s = k
j.x = k
j.q = k
j.p = d
n.s = c
i.o = m
i.x = c
i.u = n
h.w = i
k.x = c
c.u = d
m.w = i
d.s = c
f.w = m
f.t = i
f.s = k
f.x = k
f.q = k
f.p = d
assert i.o.w.o.w.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: C = None
        self.s: E = None
        self.x: E = None
        self.q: E = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

j = A("j")
n = B("n")
i = C("i")
h = D("h")
k = E("k")
c = F("c")
m = D("m")
d = B("d")
f = A("f")

j.w = m
j.t = i
j.s = k
j.x = k
j.q = k
j.p = d
n.s = c
i.o = m
i.x = c
i.u = n
h.w = i
k.x = c
c.u = d
m.w = i
d.s = c
f.w = m
f.t = i
f.s = k
f.x = k
f.q = k
f.p = d
assert i.o.w.o.w.o.w.txt == "i"