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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: G = None
        self.o: H = None
        self.p: G = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: E = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: G = None
        self.o: H = None
        self.p: G = None
        self.q: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: G = None
        self.p: E = None
        self.txt = txt

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

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