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

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

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

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

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

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

g.o = l
g.q = l
g.w = i
g.x = i
g.t = k
j.y = a
j.o = i
j.w = i
j.t = k
j.z = h
k.y = i
l.v = h
l.p = j
i.x = d
i.p = l
h.y = a
h.o = i
h.w = i
h.t = k
h.z = j
d.o = l
d.q = l
d.w = i
d.x = i
d.t = k
a.y = h
a.z = h
a.o = i
a.w = i
a.t = k
assert a.t.y.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.w: E = None
        self.q: D = None
        self.t: C = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

g.o = l
g.q = l
g.w = i
g.x = i
g.t = k
j.y = a
j.o = i
j.w = i
j.t = k
j.z = h
k.y = i
l.v = h
l.p = j
i.x = d
i.p = l
h.y = a
h.o = i
h.w = i
h.t = k
h.z = j
d.o = l
d.q = l
d.w = i
d.x = i
d.t = k
a.y = h
a.z = h
a.o = i
a.w = i
a.t = k
assert a.t.y.p.txt == "l"