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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: A = None
        self.u: E = None
        self.x: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: G = None
        self.v: A = None
        self.u: E = None
        self.x: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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