class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

c = A("c")
k = B("k")
l = C("l")
b = D("b")
j = E("j")
a = F("a")
g = B("g")
m = D("m")

c.y = g
c.t = a
c.q = j
c.u = m
k.z = l
k.u = l
k.p = l
k.r = g
k.q = b
l.y = m
l.v = j
b.z = a
b.s = g
j.p = l
j.z = l
a.y = m
a.u = c
a.t = l
a.p = b
a.q = b
a.z = k
g.z = l
g.u = l
g.p = l
g.r = k
g.q = m
m.z = a
m.s = g
assert m.z.y.z.t.y.z.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: F = None
        self.q: E = None
        self.u: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: C = None
        self.txt = txt

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

c = A("c")
k = B("k")
l = C("l")
b = D("b")
j = E("j")
a = F("a")
g = B("g")
m = D("m")

c.y = g
c.t = a
c.q = j
c.u = m
k.z = l
k.u = l
k.p = l
k.r = g
k.q = b
l.y = m
l.v = j
b.z = a
b.s = g
j.p = l
j.z = l
a.y = m
a.u = c
a.t = l
a.p = b
a.q = b
a.z = k
g.z = l
g.u = l
g.p = l
g.r = k
g.q = m
m.z = a
m.s = g
assert m.z.y.z.t.y.z.u.t.txt == "a"