class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.v: B = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: A = None
        self.v: C = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

g = A("g")
e = B("e")
k = C("k")
h = D("h")
f = E("f")
a = B("a")
j = A("j")
d = B("d")

g.o = a
e.y = a
e.v = a
e.p = g
e.q = d
e.s = f
k.w = d
k.v = j
k.o = f
k.s = a
h.y = j
h.s = j
h.v = f
f.t = k
f.v = k
f.s = j
f.p = h
f.y = h
a.y = e
a.p = j
a.v = d
a.q = d
a.s = f
j.o = a
d.y = e
d.v = e
d.q = e
d.p = g
d.s = f
assert k.o.y.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: A = None
        self.v: B = None
        self.q: B = None
        self.s: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.s: A = None
        self.v: C = None
        self.p: D = None
        self.y: D = None
        self.txt = txt

g = A("g")
e = B("e")
k = C("k")
h = D("h")
f = E("f")
a = B("a")
j = A("j")
d = B("d")

g.o = a
e.y = a
e.v = a
e.p = g
e.q = d
e.s = f
k.w = d
k.v = j
k.o = f
k.s = a
h.y = j
h.s = j
h.v = f
f.t = k
f.v = k
f.s = j
f.p = h
f.y = h
a.y = e
a.p = j
a.v = d
a.q = d
a.s = f
j.o = a
d.y = e
d.v = e
d.q = e
d.p = g
d.s = f
assert k.o.y.s.o.txt == "a"