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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.q: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: C = None
        self.w: C = None
        self.q: A = None
        self.txt = txt

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

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

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

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