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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.u: D = None
        self.x: C = None
        self.o: D = None
        self.y: E = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: G = None
        self.t: D = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.u: D = None
        self.x: C = None
        self.o: D = None
        self.y: E = None
        self.w: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.q: G = None
        self.t: D = None
        self.w: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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