class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.q: H = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.t: I = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: D = None
        self.v: G = None
        self.q: H = None
        self.txt = txt

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

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