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

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

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

i = A("i")
b = B("b")
e = C("e")
c = A("c")
g = B("g")
k = B("k")
h = B("h")
d = B("d")
j = B("j")

i.w = d
i.y = e
i.s = c
b.s = j
b.r = i
b.u = i
e.r = c
c.w = k
c.y = e
c.s = i
g.s = d
g.r = c
g.u = i
k.s = b
k.r = i
k.u = c
h.s = k
h.r = c
h.u = c
d.s = j
d.r = c
d.u = c
j.s = b
j.r = i
j.u = i
assert h.r.s.y.r.w.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.y: C = None
        self.s: A = None
        self.txt = txt

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

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

i = A("i")
b = B("b")
e = C("e")
c = A("c")
g = B("g")
k = B("k")
h = B("h")
d = B("d")
j = B("j")

i.w = d
i.y = e
i.s = c
b.s = j
b.r = i
b.u = i
e.r = c
c.w = k
c.y = e
c.s = i
g.s = d
g.r = c
g.u = i
k.s = b
k.r = i
k.u = c
h.s = k
h.r = c
h.u = c
d.s = j
d.r = c
d.u = c
j.s = b
j.r = i
j.u = i
assert h.r.s.y.r.w.u.w.u.txt == "c"