class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.u: A = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

g = A("g")
f = B("f")
j = C("j")
c = D("c")
i = E("i")
m = F("m")
l = G("l")
n = A("n")
e = D("e")
d = E("d")

g.r = j
g.q = j
g.o = i
g.u = n
g.v = c
f.v = j
f.w = d
f.p = e
j.y = f
j.x = n
j.o = l
c.r = j
i.v = d
m.p = j
m.u = j
m.z = c
l.s = f
n.r = j
n.q = j
n.o = d
n.u = g
n.v = c
e.r = j
d.v = i
assert g.o.v.v.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.u: A = None
        self.q: C = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: E = None
        self.p: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: D = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

g = A("g")
f = B("f")
j = C("j")
c = D("c")
i = E("i")
m = F("m")
l = G("l")
n = A("n")
e = D("e")
d = E("d")

g.r = j
g.q = j
g.o = i
g.u = n
g.v = c
f.v = j
f.w = d
f.p = e
j.y = f
j.x = n
j.o = l
c.r = j
i.v = d
m.p = j
m.u = j
m.z = c
l.s = f
n.r = j
n.q = j
n.o = d
n.u = g
n.v = c
e.r = j
d.v = i
assert g.o.v.v.v.v.txt == "i"