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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.u: G = None
        self.t: A = None
        self.o: E = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.y: B = None
        self.z: H = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.r: F = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

a = A("a")
b = B("b")
c = C("c")
m = D("m")
k = E("k")
f = F("f")
i = G("i")
d = H("d")
e = F("e")

a.q = b
a.w = b
a.z = c
a.u = c
a.t = c
a.p = m
b.x = c
b.s = d
b.u = i
b.t = a
b.o = k
b.z = m
b.r = m
c.v = b
c.o = b
c.y = m
m.z = b
m.t = f
k.v = b
k.x = d
f.t = d
f.z = d
f.v = d
f.q = a
f.y = b
f.o = k
i.t = m
i.v = d
i.r = f
i.y = a
i.s = c
d.y = k
e.t = d
e.z = d
e.v = d
e.q = a
e.y = b
e.o = k
assert f.t.y.x.y.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: C = None
        self.u: C = None
        self.w: B = None
        self.p: D = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: H = None
        self.u: G = None
        self.t: A = None
        self.o: E = None
        self.z: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.q: A = None
        self.y: B = None
        self.z: H = None
        self.o: E = None
        self.v: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: H = None
        self.r: F = None
        self.y: A = None
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

a = A("a")
b = B("b")
c = C("c")
m = D("m")
k = E("k")
f = F("f")
i = G("i")
d = H("d")
e = F("e")

a.q = b
a.w = b
a.z = c
a.u = c
a.t = c
a.p = m
b.x = c
b.s = d
b.u = i
b.t = a
b.o = k
b.z = m
b.r = m
c.v = b
c.o = b
c.y = m
m.z = b
m.t = f
k.v = b
k.x = d
f.t = d
f.z = d
f.v = d
f.q = a
f.y = b
f.o = k
i.t = m
i.v = d
i.r = f
i.y = a
i.s = c
d.y = k
e.t = d
e.z = d
e.v = d
e.q = a
e.y = b
e.o = k
assert f.t.y.x.y.x.y.txt == "k"