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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: G = None
        self.o: D = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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