class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.p: F = None
        self.r: A = None
        self.u: B = None
        self.q: B = 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.w: A = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

e = A("e")
b = B("b")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
f = G("f")
k = H("k")

e.v = a
b.v = a
b.u = e
b.y = e
b.s = f
b.r = c
h.r = c
a.t = j
c.o = a
c.x = a
c.p = j
c.r = e
c.u = b
c.q = b
j.x = f
f.w = e
f.s = e
f.x = b
f.t = c
k.s = j
assert k.s.x.s.v.t.x.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: D = None
        self.p: F = None
        self.r: A = None
        self.u: B = None
        self.q: B = 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.w: A = None
        self.s: A = None
        self.x: B = None
        self.t: E = None
        self.txt = txt

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

e = A("e")
b = B("b")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
f = G("f")
k = H("k")

e.v = a
b.v = a
b.u = e
b.y = e
b.s = f
b.r = c
h.r = c
a.t = j
c.o = a
c.x = a
c.p = j
c.r = e
c.u = b
c.q = b
j.x = f
f.w = e
f.s = e
f.x = b
f.t = c
k.s = j
assert k.s.x.s.v.t.x.x.y.txt == "e"