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

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

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

c = A("c")
h = B("h")
m = C("m")
k = B("k")
d = A("d")
n = C("n")
j = A("j")
e = A("e")

c.o = h
c.r = d
c.v = n
h.t = k
h.q = k
h.y = k
m.t = e
m.x = h
k.t = h
k.q = h
k.y = h
d.o = k
d.r = j
d.v = m
n.t = d
n.x = k
j.o = h
j.r = d
j.v = n
e.o = k
e.r = c
e.v = m
assert c.r.o.t.y.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: A = None
        self.v: C = None
        self.txt = txt

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

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

c = A("c")
h = B("h")
m = C("m")
k = B("k")
d = A("d")
n = C("n")
j = A("j")
e = A("e")

c.o = h
c.r = d
c.v = n
h.t = k
h.q = k
h.y = k
m.t = e
m.x = h
k.t = h
k.q = h
k.y = h
d.o = k
d.r = j
d.v = m
n.t = d
n.x = k
j.o = h
j.r = d
j.v = n
e.o = k
e.r = c
e.v = m
assert c.r.o.t.y.t.q.txt == "k"