class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.z: I = None
        self.u: I = None
        self.v: G = None
        self.y: I = None
        self.p: H = None
        self.w: I = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.z: I = None
        self.u: I = None
        self.v: G = None
        self.y: I = None
        self.p: H = None
        self.w: I = None
        self.txt = txt

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

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

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

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

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