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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: E = None
        self.u: I = None
        self.y: I = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.q: I = 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.u: I = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.q: J = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: F = None
        self.p: E = None
        self.u: I = None
        self.y: I = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: A = None
        self.q: I = 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.u: I = None
        self.t: F = None
        self.q: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.q: J = None
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: F = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

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

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

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