class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: E = None
        self.o: G = None
        self.p: E = None
        self.y: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: F = None
        self.x: D = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.v: F = None
        self.u: D = None
        self.r: H = None
        self.q: D = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.s: B = None
        self.x: H = None
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: D = None
        self.z: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: F = None
        self.x: D = None
        self.u: H = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.o: E = None
        self.v: F = None
        self.u: D = None
        self.r: H = None
        self.q: D = None
        self.z: G = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: G = None
        self.s: B = None
        self.x: H = None
        self.w: C = None
        self.y: F = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: D = None
        self.z: A = None
        self.txt = txt

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

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