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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.u: D = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: F = None
        self.u: A = None
        self.p: I = None
        self.w: A = None
        self.y: F = None
        self.z: G = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.u: I = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: E = None
        self.t: C = None
        self.v: C = None
        self.x: F = None
        self.z: B = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.u: D = None
        self.s: C = None
        self.y: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: F = None
        self.u: A = None
        self.p: I = None
        self.w: A = None
        self.y: F = None
        self.z: G = None
        self.r: D = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.u: I = None
        self.p: A = None
        self.q: B = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: I = None
        self.p: E = None
        self.t: C = None
        self.v: C = None
        self.x: F = None
        self.z: B = None
        self.s: C = None
        self.q: C = None
        self.txt = txt

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

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

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