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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.r: A = None
        self.q: I = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: I = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: I = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: H = None
        self.r: A = None
        self.q: I = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.t: I = None
        self.o: H = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: C = None
        self.w: A = None
        self.p: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: D = None
        self.txt = txt

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

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