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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: H = None
        self.s: D = None
        self.w: J = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: I = None
        self.w: F = None
        self.t: C = None
        self.o: F = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.p: G = None
        self.w: D = None
        self.r: H = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

i = A("i")
f = B("f")
b = C("b")
j = D("j")
c = E("c")
d = F("d")
k = G("k")
e = H("e")
g = I("g")
m = J("m")

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

class B:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: H = None
        self.u: J = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: H = None
        self.r: H = None
        self.s: D = None
        self.w: J = None
        self.q: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: I = None
        self.w: F = None
        self.t: C = None
        self.o: F = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: B = None
        self.p: G = None
        self.w: D = None
        self.r: H = None
        self.t: C = None
        self.q: G = None
        self.txt = txt

i = A("i")
f = B("f")
b = C("b")
j = D("j")
c = E("c")
d = F("d")
k = G("k")
e = H("e")
g = I("g")
m = J("m")

i.p = k
f.r = k
f.z = e
f.u = m
b.z = e
b.r = e
b.s = j
b.w = m
b.q = c
j.y = k
j.x = k
j.s = f
j.o = f
j.p = c
j.u = g
c.u = k
c.t = k
d.u = m
k.x = b
e.q = g
e.p = g
e.w = d
e.o = d
e.t = b
e.z = b
e.s = k
g.r = k
g.s = i
g.y = b
m.y = i
m.s = f
m.p = k
m.q = k
m.w = j
m.r = e
m.t = b
assert i.p.x.q.txt == "c"