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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.w: E = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.y: C = None
        self.w: E = None
        self.r: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

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