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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.p: A = None
        self.s: D = None
        self.v: F = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: G = None
        self.p: A = None
        self.s: D = None
        self.v: F = None
        self.z: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

f.q = d
m.x = f
m.p = f
m.t = f
m.y = d
m.s = n
m.v = e
m.z = e
g.r = b
g.w = b
g.p = l
n.x = b
n.q = e
n.w = e
n.v = f
b.r = d
b.o = d
b.y = d
b.s = d
b.z = a
b.x = i
b.v = n
e.y = a
e.q = a
e.o = d
e.r = f
d.o = b
d.s = n
d.v = n
d.y = l
a.r = d
a.o = d
a.y = d
a.s = d
a.z = b
a.x = g
a.v = n
l.x = f
l.p = f
l.t = f
l.y = d
l.s = n
l.v = e
l.z = e
i.r = b
i.p = m
i.w = a
assert n.v.q.s.x.x.w.y.txt == "d"