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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.txt = txt

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

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

j.u = i
j.t = i
g.y = i
g.v = b
g.o = e
i.r = g
i.z = a
e.z = l
e.x = g
n.p = l
n.q = k
l.r = b
l.x = b
l.z = j
l.w = i
a.p = d
a.q = k
b.z = l
b.x = g
k.y = i
k.v = e
k.o = e
d.r = e
d.x = e
d.z = j
d.w = i
assert k.y.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.q: B = None
        self.txt = txt

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

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

j.u = i
j.t = i
g.y = i
g.v = b
g.o = e
i.r = g
i.z = a
e.z = l
e.x = g
n.p = l
n.q = k
l.r = b
l.x = b
l.z = j
l.w = i
a.p = d
a.q = k
b.z = l
b.x = g
k.y = i
k.v = e
k.o = e
d.r = e
d.x = e
d.z = j
d.w = i
assert k.y.z.q.txt == "k"