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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.t: D = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

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

j.y = n
j.p = g
e.y = b
h.t = j
c.y = g
g.t = h
g.u = n
n.r = e
n.y = h
n.s = h
n.x = l
l.s = g
l.p = g
l.t = c
l.v = b
l.r = e
b.u = e
assert n.r.y.u.y.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: E = None
        self.t: D = None
        self.v: H = None
        self.r: B = None
        self.txt = txt

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

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

j.y = n
j.p = g
e.y = b
h.t = j
c.y = g
g.t = h
g.u = n
n.r = e
n.y = h
n.s = h
n.x = l
l.s = g
l.p = g
l.t = c
l.v = b
l.r = e
b.u = e
assert n.r.y.u.y.u.txt == "e"