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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: B = None
        self.x: I = None
        self.q: G = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.q: I = None
        self.s: D = None
        self.o: J = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.y: J = None
        self.v: I = None
        self.w: D = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: G = None
        self.w: H = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: A = None
        self.y: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.v: B = None
        self.x: I = None
        self.q: G = None
        self.w: E = None
        self.r: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: D = None
        self.q: I = None
        self.s: D = None
        self.o: J = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.t: I = None
        self.y: J = None
        self.v: I = None
        self.w: D = None
        self.z: B = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: H = None
        self.x: G = None
        self.w: H = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.o: B = None
        self.p: B = None
        self.txt = txt

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

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