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

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

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

j = A("j")
f = B("f")
b = C("b")
c = C("c")
i = A("i")
h = B("h")
a = B("a")
e = C("e")

j.w = h
j.q = c
j.v = e
f.t = a
f.q = i
b.y = e
b.t = j
c.y = e
c.t = i
i.w = h
i.q = e
i.v = b
h.t = f
h.q = i
a.t = h
a.q = j
e.y = c
e.t = j
assert e.y.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: C = None
        self.v: C = None
        self.txt = txt

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

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

j = A("j")
f = B("f")
b = C("b")
c = C("c")
i = A("i")
h = B("h")
a = B("a")
e = C("e")

j.w = h
j.q = c
j.v = e
f.t = a
f.q = i
b.y = e
b.t = j
c.y = e
c.t = i
i.w = h
i.q = e
i.v = b
h.t = f
h.q = i
a.t = h
a.q = j
e.y = c
e.t = j
assert e.y.t.w.txt == "h"