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

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

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

n = A("n")
l = B("l")
e = C("e")
f = C("f")
j = A("j")
b = C("b")
k = B("k")
a = B("a")
g = C("g")
h = B("h")

n.q = l
n.o = j
n.u = h
l.y = g
l.u = b
l.w = b
e.t = h
f.t = a
j.q = l
j.o = n
j.u = k
b.t = h
k.y = b
k.w = b
k.u = g
a.y = f
a.u = f
a.w = e
g.t = a
h.y = g
h.u = f
h.w = f
assert l.y.t.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: A = None
        self.u: B = None
        self.txt = txt

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

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

n = A("n")
l = B("l")
e = C("e")
f = C("f")
j = A("j")
b = C("b")
k = B("k")
a = B("a")
g = C("g")
h = B("h")

n.q = l
n.o = j
n.u = h
l.y = g
l.u = b
l.w = b
e.t = h
f.t = a
j.q = l
j.o = n
j.u = k
b.t = h
k.y = b
k.w = b
k.u = g
a.y = f
a.u = f
a.w = e
g.t = a
h.y = g
h.u = f
h.w = f
assert l.y.t.y.txt == "f"