class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: G = None
        self.u: B = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.w: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.r: A = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.y: E = None
        self.o: G = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: H = None
        self.txt = txt

a = A("a")
g = B("g")
j = C("j")
n = D("n")
l = E("l")
h = F("h")
c = G("c")
e = H("e")
m = I("m")
k = B("k")

a.p = n
a.w = c
a.t = c
a.u = k
a.q = j
g.u = j
g.v = l
j.t = l
n.x = m
n.t = k
n.w = g
n.v = j
l.q = j
l.v = j
l.x = n
l.s = n
l.o = c
h.o = e
c.p = a
c.r = a
c.y = n
c.u = l
c.z = k
e.w = l
e.y = l
e.z = n
e.o = c
e.s = a
m.w = e
m.q = e
k.u = j
k.v = l
assert m.q.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: G = None
        self.u: B = None
        self.t: G = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.w: B = None
        self.v: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: D = None
        self.r: A = None
        self.u: E = None
        self.z: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: D = None
        self.y: E = None
        self.o: G = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.q: H = None
        self.txt = txt

a = A("a")
g = B("g")
j = C("j")
n = D("n")
l = E("l")
h = F("h")
c = G("c")
e = H("e")
m = I("m")
k = B("k")

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