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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: D = None
        self.r: F = None
        self.q: H = None
        self.u: H = None
        self.w: G = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

a = A("a")
f = B("f")
n = C("n")
g = D("g")
c = E("c")
i = F("i")
e = G("e")
d = H("d")
j = E("j")
k = F("k")

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.z: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: D = None
        self.r: F = None
        self.q: H = None
        self.u: H = None
        self.w: G = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: C = None
        self.s: B = None
        self.t: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

a = A("a")
f = B("f")
n = C("n")
g = D("g")
c = E("c")
i = F("i")
e = G("e")
d = H("d")
j = E("j")
k = F("k")

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