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

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

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

n = A("n")
i = B("i")
f = C("f")
j = C("j")
e = C("e")
d = A("d")
c = B("c")
g = A("g")
b = C("b")

n.x = g
n.o = d
n.w = j
i.r = f
i.v = d
f.o = e
f.t = c
f.u = d
j.o = b
j.t = c
j.u = d
e.o = j
e.t = i
e.u = g
d.x = g
d.o = n
d.w = f
c.r = b
c.v = n
g.x = d
g.o = d
g.w = j
b.o = j
b.t = i
b.u = g
assert c.r.o.o.t.r.t.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: A = None
        self.w: C = None
        self.txt = txt

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

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

n = A("n")
i = B("i")
f = C("f")
j = C("j")
e = C("e")
d = A("d")
c = B("c")
g = A("g")
b = C("b")

n.x = g
n.o = d
n.w = j
i.r = f
i.v = d
f.o = e
f.t = c
f.u = d
j.o = b
j.t = c
j.u = d
e.o = j
e.t = i
e.u = g
d.x = g
d.o = n
d.w = f
c.r = b
c.v = n
g.x = d
g.o = d
g.w = j
b.o = j
b.t = i
b.u = g
assert c.r.o.o.t.r.t.v.x.txt == "g"