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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: D = None
        self.o: C = None
        self.z: H = None
        self.x: H = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.s: H = None
        self.u: B = None
        self.r: C = None
        self.q: F = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

a = A("a")
b = B("b")
f = C("f")
n = D("n")
g = E("g")
l = F("l")
h = G("h")
m = H("m")
c = I("c")

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.z: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.u: E = None
        self.r: A = None
        self.w: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: I = None
        self.z: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.v: D = None
        self.o: C = None
        self.z: H = None
        self.x: H = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.x: H = None
        self.y: H = None
        self.s: H = None
        self.u: B = None
        self.r: C = None
        self.q: F = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

a = A("a")
b = B("b")
f = C("f")
n = D("n")
g = E("g")
l = F("l")
h = G("h")
m = H("m")
c = I("c")

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