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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.z: F = None
        self.t: B = None
        self.v: E = None
        self.txt = txt

m = A("m")
b = B("b")
n = C("n")
g = D("g")
k = E("k")
e = F("e")
j = G("j")
i = H("i")

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.z: E = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: A = None
        self.z: F = None
        self.t: B = None
        self.v: E = None
        self.txt = txt

m = A("m")
b = B("b")
n = C("n")
g = D("g")
k = E("k")
e = F("e")
j = G("j")
i = H("i")

m.p = b
b.q = k
b.z = k
b.u = k
n.w = e
n.z = k
g.o = e
g.u = e
g.q = e
g.v = b
g.w = n
k.s = j
k.r = j
k.q = m
k.v = m
k.x = g
k.o = b
k.y = e
e.z = b
e.p = g
j.z = e
j.u = m
i.y = e
i.z = e
i.o = m
i.t = b
i.v = k
assert j.u.p.q.r.txt == "j"