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

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

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

c = A("c")
h = B("h")
l = C("l")
i = C("i")
n = B("n")
b = C("b")

c.w = h
c.t = n
h.w = n
h.u = n
h.v = c
l.r = i
l.y = i
l.q = i
i.r = b
i.y = l
i.q = l
n.w = h
n.u = h
n.v = c
b.r = i
b.q = i
b.y = l
assert l.y.q.y.r.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

c = A("c")
h = B("h")
l = C("l")
i = C("i")
n = B("n")
b = C("b")

c.w = h
c.t = n
h.w = n
h.u = n
h.v = c
l.r = i
l.y = i
l.q = i
i.r = b
i.y = l
i.q = l
n.w = h
n.u = h
n.v = c
b.r = i
b.q = i
b.y = l
assert l.y.q.y.r.y.y.txt == "i"