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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

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

g = A("g")
l = B("l")
f = C("f")
h = D("h")
i = E("i")
d = C("d")
e = A("e")
k = E("k")

g.x = d
g.t = k
l.p = f
l.q = f
l.x = d
f.v = h
h.z = d
h.u = f
i.u = g
i.v = g
i.r = k
i.y = k
d.v = h
e.x = f
e.t = i
k.u = e
k.v = e
k.r = i
k.y = i
assert k.r.y.y.y.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: C = None
        self.q: C = None
        self.txt = txt

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

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

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

g = A("g")
l = B("l")
f = C("f")
h = D("h")
i = E("i")
d = C("d")
e = A("e")
k = E("k")

g.x = d
g.t = k
l.p = f
l.q = f
l.x = d
f.v = h
h.z = d
h.u = f
i.u = g
i.v = g
i.r = k
i.y = k
d.v = h
e.x = f
e.t = i
k.u = e
k.v = e
k.r = i
k.y = i
assert k.r.y.y.y.y.v.txt == "g"