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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.s: B = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.r: A = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

c = A("c")
m = B("m")
e = C("e")
d = D("d")
b = E("b")
f = F("f")
h = B("h")
a = D("a")
j = A("j")
g = C("g")

c.r = g
c.v = b
m.z = a
m.q = d
m.v = b
m.x = h
e.w = b
e.t = b
e.o = b
e.x = m
d.x = m
d.r = g
d.w = g
b.r = f
b.v = a
b.s = h
b.q = c
f.s = b
f.p = d
f.r = c
f.x = a
f.z = j
h.z = a
h.q = a
h.v = b
h.x = m
a.x = m
a.r = g
a.w = g
j.r = e
j.v = b
g.w = b
g.t = b
g.o = b
g.x = h
assert j.r.x.x.x.v.q.v.q.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.v: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: D = None
        self.v: E = None
        self.x: B = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.s: B = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.p: D = None
        self.r: A = None
        self.x: D = None
        self.z: A = None
        self.txt = txt

c = A("c")
m = B("m")
e = C("e")
d = D("d")
b = E("b")
f = F("f")
h = B("h")
a = D("a")
j = A("j")
g = C("g")

c.r = g
c.v = b
m.z = a
m.q = d
m.v = b
m.x = h
e.w = b
e.t = b
e.o = b
e.x = m
d.x = m
d.r = g
d.w = g
b.r = f
b.v = a
b.s = h
b.q = c
f.s = b
f.p = d
f.r = c
f.x = a
f.z = j
h.z = a
h.q = a
h.v = b
h.x = m
a.x = m
a.r = g
a.w = g
j.r = e
j.v = b
g.w = b
g.t = b
g.o = b
g.x = h
assert j.r.x.x.x.v.q.v.q.v.q.txt == "c"