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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.z: E = None
        self.o: G = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.q: H = None
        self.r: D = None
        self.v: E = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.q: G = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.z: G = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: G = None
        self.s: G = None
        self.z: E = None
        self.v: H = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: G = None
        self.z: E = None
        self.o: G = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.t: D = None
        self.q: H = None
        self.r: D = None
        self.v: E = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: B = None
        self.q: G = None
        self.z: D = None
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: A = None
        self.z: G = None
        self.t: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: G = None
        self.s: G = None
        self.z: E = None
        self.v: H = None
        self.q: E = None
        self.p: E = None
        self.txt = txt

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

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