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

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

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

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

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

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

g.s = h
g.q = b
g.u = c
m.y = h
m.q = j
m.v = c
m.r = c
h.q = d
h.r = d
h.s = b
j.u = c
l.r = d
c.y = b
c.q = j
c.v = m
c.r = m
f.r = g
b.q = g
b.r = d
b.s = h
d.s = b
d.q = b
d.u = c
assert c.y.s.q.u.r.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

g.s = h
g.q = b
g.u = c
m.y = h
m.q = j
m.v = c
m.r = c
h.q = d
h.r = d
h.s = b
j.u = c
l.r = d
c.y = b
c.q = j
c.v = m
c.r = m
f.r = g
b.q = g
b.r = d
b.s = h
d.s = b
d.q = b
d.u = c
assert c.y.s.q.u.r.y.s.txt == "b"