class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.v: C = None
        self.txt = txt

a = A("a")
b = B("b")
l = C("l")
d = D("d")
h = E("h")
e = E("e")
n = A("n")
m = E("m")
g = C("g")

a.o = m
a.p = m
a.r = e
a.w = n
b.p = m
b.y = m
b.t = e
l.t = g
l.y = g
l.q = d
l.p = b
d.p = b
d.x = m
h.u = b
h.w = m
h.v = l
e.u = b
e.w = h
e.v = l
n.o = h
n.p = e
n.r = m
n.w = a
m.u = b
m.w = h
m.v = l
g.t = l
g.y = l
g.q = d
g.p = b
assert b.y.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.p: E = None
        self.r: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.w: E = None
        self.v: C = None
        self.txt = txt

a = A("a")
b = B("b")
l = C("l")
d = D("d")
h = E("h")
e = E("e")
n = A("n")
m = E("m")
g = C("g")

a.o = m
a.p = m
a.r = e
a.w = n
b.p = m
b.y = m
b.t = e
l.t = g
l.y = g
l.q = d
l.p = b
d.p = b
d.x = m
h.u = b
h.w = m
h.v = l
e.u = b
e.w = h
e.v = l
n.o = h
n.p = e
n.r = m
n.w = a
m.u = b
m.w = h
m.v = l
g.t = l
g.y = l
g.q = d
g.p = b
assert b.y.v.q.txt == "d"