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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.txt = txt

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

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

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

b.t = c
b.y = f
b.x = k
b.o = g
b.r = i
c.y = b
a.v = i
k.y = c
k.p = b
f.u = j
i.r = a
i.z = c
n.y = c
n.p = b
l.u = j
g.v = j
j.r = g
j.z = c
assert a.v.z.y.r.z.y.y.u.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.y: E = None
        self.x: D = None
        self.o: C = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.txt = txt

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

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

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

b.t = c
b.y = f
b.x = k
b.o = g
b.r = i
c.y = b
a.v = i
k.y = c
k.p = b
f.u = j
i.r = a
i.z = c
n.y = c
n.p = b
l.u = j
g.v = j
j.r = g
j.z = c
assert a.v.z.y.r.z.y.y.u.z.y.txt == "b"