class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.y: C = None
        self.x: G = None
        self.q: D = None
        self.t: B = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: A = None
        self.p: G = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: G = None
        self.x: C = None
        self.txt = txt

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

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

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