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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.r: H = None
        self.w: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: A = None
        self.x: F = None
        self.s: D = None
        self.w: J = None
        self.q: G = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: A = None
        self.y: G = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: I = None
        self.p: G = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.r: H = None
        self.w: G = None
        self.o: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.t: A = None
        self.x: F = None
        self.s: D = None
        self.w: J = None
        self.q: G = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: A = None
        self.y: G = None
        self.r: D = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: I = None
        self.p: G = None
        self.v: B = None
        self.t: E = None
        self.txt = txt

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

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