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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.z: E = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: D = None
        self.y: A = None
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: B = None
        self.z: E = None
        self.o: A = None
        self.q: A = None
        self.txt = txt

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

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