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

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

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

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

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

d = A("d")
h = B("h")
f = C("f")
j = D("j")
c = E("c")
b = B("b")

d.s = c
d.o = c
d.u = c
d.v = b
h.o = d
h.x = j
h.w = j
h.t = j
h.q = b
f.z = j
f.p = b
f.s = c
j.p = d
c.x = f
c.u = d
b.o = d
b.x = j
b.w = j
b.t = j
b.q = h
assert c.u.v.o.v.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: E = None
        self.u: E = None
        self.v: B = None
        self.txt = txt

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

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

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

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

d = A("d")
h = B("h")
f = C("f")
j = D("j")
c = E("c")
b = B("b")

d.s = c
d.o = c
d.u = c
d.v = b
h.o = d
h.x = j
h.w = j
h.t = j
h.q = b
f.z = j
f.p = b
f.s = c
j.p = d
c.x = f
c.u = d
b.o = d
b.x = j
b.w = j
b.t = j
b.q = h
assert c.u.v.o.v.q.q.txt == "b"