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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: A = None
        self.t: F = None
        self.z: F = None
        self.y: E = None
        self.o: H = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: A = None
        self.x: A = None
        self.y: F = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: G = None
        self.y: A = None
        self.o: G = None
        self.z: G = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.w: A = None
        self.s: B = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

d = A("d")
g = B("g")
f = C("f")
c = D("c")
k = E("k")
n = F("n")
m = G("m")
h = H("h")
a = H("a")

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: A = None
        self.t: F = None
        self.z: F = None
        self.y: E = None
        self.o: H = None
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.p: A = None
        self.x: A = None
        self.y: F = None
        self.t: A = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: G = None
        self.y: A = None
        self.o: G = None
        self.z: G = None
        self.r: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: D = None
        self.w: A = None
        self.s: B = None
        self.y: A = None
        self.z: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

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

d = A("d")
g = B("g")
f = C("f")
c = D("c")
k = E("k")
n = F("n")
m = G("m")
h = H("h")
a = H("a")

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