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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.t: E = None
        self.z: E = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: C = None
        self.q: B = None
        self.y: A = None
        self.w: D = None
        self.txt = txt

g = A("g")
l = B("l")
e = C("e")
k = D("k")
h = E("h")
n = E("n")
b = D("b")

g.y = k
g.v = n
g.x = e
l.r = e
e.t = k
e.z = g
k.y = l
k.p = l
k.o = b
k.t = h
k.z = h
h.s = l
h.q = l
h.p = e
h.y = g
h.w = b
n.s = l
n.q = l
n.p = e
n.y = g
n.w = k
b.y = l
b.p = l
b.o = k
b.t = h
b.z = h
assert l.r.t.p.r.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: D = None
        self.t: E = None
        self.z: E = None
        self.p: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.p: C = None
        self.q: B = None
        self.y: A = None
        self.w: D = None
        self.txt = txt

g = A("g")
l = B("l")
e = C("e")
k = D("k")
h = E("h")
n = E("n")
b = D("b")

g.y = k
g.v = n
g.x = e
l.r = e
e.t = k
e.z = g
k.y = l
k.p = l
k.o = b
k.t = h
k.z = h
h.s = l
h.q = l
h.p = e
h.y = g
h.w = b
n.s = l
n.q = l
n.p = e
n.y = g
n.w = k
b.y = l
b.p = l
b.o = k
b.t = h
b.z = h
assert l.r.t.p.r.t.y.txt == "l"