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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.o: A = None
        self.p: F = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

j = A("j")
i = B("i")
l = C("l")
a = D("a")
m = E("m")
g = F("g")
d = F("d")

j.y = d
j.x = i
i.t = d
i.w = m
i.v = a
i.y = g
l.x = g
a.q = i
a.y = j
a.w = g
m.z = a
g.t = j
g.o = j
g.w = j
g.q = a
g.p = d
g.z = m
d.t = j
d.o = j
d.w = j
d.q = a
d.p = g
d.z = m
assert i.t.z.z.q.w.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: D = None
        self.o: A = None
        self.p: F = None
        self.w: A = None
        self.z: E = None
        self.txt = txt

j = A("j")
i = B("i")
l = C("l")
a = D("a")
m = E("m")
g = F("g")
d = F("d")

j.y = d
j.x = i
i.t = d
i.w = m
i.v = a
i.y = g
l.x = g
a.q = i
a.y = j
a.w = g
m.z = a
g.t = j
g.o = j
g.w = j
g.q = a
g.p = d
g.z = m
d.t = j
d.o = j
d.w = j
d.q = a
d.p = g
d.z = m
assert i.t.z.z.q.w.z.txt == "a"