class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: B = None
        self.x: E = None
        self.r: F = None
        self.u: D = None
        self.v: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.q: A = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

g = A("g")
f = B("f")
e = C("e")
a = D("a")
b = E("b")
j = F("j")
l = B("l")

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

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

class C:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: A = None
        self.r: A = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.q: A = None
        self.u: C = None
        self.p: B = None
        self.txt = txt

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

g = A("g")
f = B("f")
e = C("e")
a = D("a")
b = E("b")
j = F("j")
l = B("l")

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