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

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

h.w = k
h.v = k
h.u = g
h.o = l
c.q = l
c.s = k
k.r = d
k.z = f
k.w = f
d.q = l
d.o = l
l.y = c
l.t = c
f.q = l
f.o = l
g.w = k
g.v = k
g.u = h
g.o = l
assert k.r.o.y.s.r.o.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: A = None
        self.o: E = None
        self.v: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.txt = txt

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

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

h.w = k
h.v = k
h.u = g
h.o = l
c.q = l
c.s = k
k.r = d
k.z = f
k.w = f
d.q = l
d.o = l
l.y = c
l.t = c
f.q = l
f.o = l
g.w = k
g.v = k
g.u = h
g.o = l
assert k.r.o.y.s.r.o.y.txt == "c"