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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.w: A = None
        self.y: B = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: F = None
        self.w: A = None
        self.y: B = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

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

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

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