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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.o: G = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.p: D = None
        self.u: E = None
        self.t: G = None
        self.v: E = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

i = A("i")
m = B("m")
l = C("l")
b = D("b")
d = E("d")
n = F("n")
k = G("k")
f = H("f")

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: A = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: C = None
        self.o: G = None
        self.u: C = None
        self.y: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: D = None
        self.p: D = None
        self.u: E = None
        self.t: G = None
        self.v: E = None
        self.w: C = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: E = None
        self.o: G = None
        self.z: F = None
        self.txt = txt

i = A("i")
m = B("m")
l = C("l")
b = D("b")
d = E("d")
n = F("n")
k = G("k")
f = H("f")

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