class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.t: F = None
        self.v: F = None
        self.y: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: G = None
        self.t: F = None
        self.v: F = None
        self.y: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: A = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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