class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: D = None
        self.v: E = None
        self.t: H = None
        self.o: E = None
        self.w: F = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: I = None
        self.y: A = None
        self.z: I = None
        self.x: I = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: A = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.q: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.r: I = None
        self.y: A = None
        self.z: I = None
        self.x: I = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: A = None
        self.t: B = None
        self.x: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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