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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.r: F = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.o: D = None
        self.r: C = None
        self.u: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.r: G = None
        self.z: C = None
        self.p: A = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.s: D = None
        self.o: A = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.z: C = None
        self.r: F = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: C = None
        self.o: D = None
        self.r: C = None
        self.u: B = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.u: B = None
        self.r: G = None
        self.z: C = None
        self.p: A = None
        self.s: A = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.s: D = None
        self.o: A = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

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

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