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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.p: H = None
        self.y: F = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

j = A("j")
n = B("n")
e = C("e")
l = D("l")
d = E("d")
c = F("c")
k = G("k")
h = H("h")

j.r = n
j.x = h
n.s = h
n.p = h
n.q = c
n.y = c
n.t = e
n.r = d
e.s = c
l.u = k
d.x = e
c.w = d
c.x = d
k.p = l
h.r = l
assert d.x.s.x.x.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: F = None
        self.p: H = None
        self.y: F = None
        self.t: C = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

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

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

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

j = A("j")
n = B("n")
e = C("e")
l = D("l")
d = E("d")
c = F("c")
k = G("k")
h = H("h")

j.r = n
j.x = h
n.s = h
n.p = h
n.q = c
n.y = c
n.t = e
n.r = d
e.s = c
l.u = k
d.x = e
c.w = d
c.x = d
k.p = l
h.r = l
assert d.x.s.x.x.s.txt == "c"