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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: B = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.u: D = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

d = A("d")
b = B("b")
a = C("a")
i = D("i")
g = E("g")
h = E("h")
l = A("l")
c = E("c")
f = D("f")

d.p = i
d.w = f
d.t = h
d.x = l
b.x = i
a.u = i
a.s = b
a.v = f
a.t = f
i.q = b
i.v = b
i.y = d
i.z = a
g.t = i
g.u = i
g.q = h
g.w = l
g.v = b
h.t = f
h.u = f
h.q = g
h.w = l
h.v = b
l.p = f
l.w = f
l.t = c
l.x = d
c.t = i
c.u = i
c.q = h
c.w = d
c.v = b
f.q = b
f.v = b
f.y = l
f.z = a
assert g.w.p.y.p.y.x.x.t.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: D = None
        self.t: E = None
        self.x: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: B = None
        self.y: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.u: D = None
        self.w: A = None
        self.v: B = None
        self.txt = txt

d = A("d")
b = B("b")
a = C("a")
i = D("i")
g = E("g")
h = E("h")
l = A("l")
c = E("c")
f = D("f")

d.p = i
d.w = f
d.t = h
d.x = l
b.x = i
a.u = i
a.s = b
a.v = f
a.t = f
i.q = b
i.v = b
i.y = d
i.z = a
g.t = i
g.u = i
g.q = h
g.w = l
g.v = b
h.t = f
h.u = f
h.q = g
h.w = l
h.v = b
l.p = f
l.w = f
l.t = c
l.x = d
c.t = i
c.u = i
c.q = h
c.w = d
c.v = b
f.q = b
f.v = b
f.y = l
f.z = a
assert g.w.p.y.p.y.x.x.t.txt == "c"