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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.z: G = None
        self.x: F = None
        self.v: E = None
        self.r: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: G = None
        self.z: G = None
        self.x: F = None
        self.v: E = None
        self.r: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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