class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: F = None
        self.w: B = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.t: F = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.s: C = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.t: F = None
        self.v: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.s: C = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

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

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

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

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