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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.q: A = None
        self.r: F = None
        self.z: G = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.txt = txt

d = A("d")
m = B("m")
f = C("f")
j = D("j")
g = E("g")
k = F("k")
n = G("n")
l = H("l")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: A = None
        self.z: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: G = None
        self.q: A = None
        self.r: F = None
        self.z: G = None
        self.p: G = None
        self.o: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.x: H = None
        self.u: H = None
        self.txt = txt

d = A("d")
m = B("m")
f = C("f")
j = D("j")
g = E("g")
k = F("k")
n = G("n")
l = H("l")
a = H("a")

d.o = m
d.q = n
d.w = g
m.o = f
m.y = d
m.z = d
f.o = l
f.s = l
f.z = d
f.v = m
f.p = k
j.q = m
g.s = j
g.u = n
g.z = n
g.p = n
g.o = n
g.q = d
g.r = k
k.r = d
k.u = d
n.u = l
n.p = k
n.t = f
l.x = a
l.u = a
a.x = l
a.u = l
assert f.s.x.u.txt == "l"