class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: D = None
        self.p: D = None
        self.x: C = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.x: F = None
        self.z: B = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

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

b = A("b")
j = B("j")
f = C("f")
h = D("h")
l = E("l")
c = F("c")
k = G("k")
e = H("e")
i = C("i")
m = G("m")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: H = None
        self.u: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: A = None
        self.x: F = None
        self.z: B = None
        self.o: G = None
        self.y: A = None
        self.txt = txt

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

b = A("b")
j = B("j")
f = C("f")
h = D("h")
l = E("l")
c = F("c")
k = G("k")
e = H("e")
i = C("i")
m = G("m")

b.r = i
b.o = h
b.p = h
b.x = f
j.o = l
j.t = c
j.w = b
f.o = l
f.z = l
f.s = j
f.p = h
f.x = h
f.q = i
f.r = i
f.y = b
h.w = j
h.r = b
h.q = k
h.y = c
h.o = l
l.o = f
l.x = b
l.s = h
c.y = j
c.p = e
c.u = h
k.q = h
k.s = b
k.y = b
k.x = c
k.z = j
k.o = m
e.r = k
i.o = l
i.z = l
i.s = j
i.p = h
i.x = h
i.q = f
i.r = f
i.y = b
m.q = h
m.s = b
m.y = b
m.x = c
m.z = j
m.o = k
assert c.u.o.x.x.y.o.o.s.w.txt == "j"