class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.o: G = None
        self.z: A = None
        self.s: E = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.r: A = None
        self.w: A = None
        self.s: B = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: B = None
        self.p: E = None
        self.y: B = None
        self.s: E = None
        self.x: G = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: D = None
        self.o: G = None
        self.z: A = None
        self.s: E = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: F = None
        self.r: A = None
        self.w: A = None
        self.s: B = None
        self.p: A = None
        self.q: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: F = None
        self.q: B = None
        self.p: E = None
        self.y: B = None
        self.s: E = None
        self.x: G = None
        self.r: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: A = None
        self.z: D = None
        self.txt = txt

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

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