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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.q: E = None
        self.t: D = None
        self.p: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
a = C("a")
l = D("l")
j = E("j")
h = D("h")
g = B("g")
b = C("b")

k.x = j
i.y = b
a.v = h
a.y = j
a.q = j
a.p = j
a.t = l
l.r = h
l.t = h
j.p = i
h.r = l
h.t = l
g.y = a
b.v = h
b.t = h
b.y = j
b.q = j
b.p = j
assert k.x.p.y.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: E = None
        self.q: E = None
        self.t: D = None
        self.p: E = None
        self.txt = txt

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

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

k = A("k")
i = B("i")
a = C("a")
l = D("l")
j = E("j")
h = D("h")
g = B("g")
b = C("b")

k.x = j
i.y = b
a.v = h
a.y = j
a.q = j
a.p = j
a.t = l
l.r = h
l.t = h
j.p = i
h.r = l
h.t = l
g.y = a
b.v = h
b.t = h
b.y = j
b.q = j
b.p = j
assert k.x.p.y.y.p.txt == "i"