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

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

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

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

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

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

f = A("f")
m = B("m")
j = C("j")
k = D("k")
d = E("d")
g = F("g")
e = E("e")
c = D("c")

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

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

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

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

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

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

f = A("f")
m = B("m")
j = C("j")
k = D("k")
d = E("d")
g = F("g")
e = E("e")
c = D("c")

f.w = g
f.x = g
f.z = j
f.v = j
f.r = c
m.x = j
m.w = c
m.p = c
m.t = d
j.p = g
k.o = f
k.t = d
d.w = g
d.q = f
g.w = f
g.t = m
g.z = e
g.q = e
e.w = g
e.q = f
c.o = f
c.t = d
assert m.x.p.t.t.q.z.p.t.txt == "m"