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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.txt = txt

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

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

b.t = j
i.s = g
i.u = n
e.u = m
e.q = g
e.v = n
n.s = i
n.p = m
n.w = j
n.z = b
l.x = g
l.r = g
m.q = i
m.t = i
m.r = g
g.x = l
g.r = l
j.u = m
j.q = l
j.v = n
k.u = m
k.q = l
k.v = n
assert m.t.u.z.t.u.q.s.txt == "g"