class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: D = None
        self.v: D = None
        self.p: A = None
        self.y: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
m = C("m")
e = D("e")
k = E("k")
h = F("h")
f = G("f")
g = D("g")
a = F("a")
j = A("j")

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: E = None
        self.o: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: A = None
        self.y: F = None
        self.w: D = None
        self.txt = txt

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

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

i = A("i")
d = B("d")
m = C("m")
e = D("e")
k = E("k")
h = F("h")
f = G("f")
g = D("g")
a = F("a")
j = A("j")

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