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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: H = None
        self.u: I = None
        self.p: I = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.s: H = None
        self.t: H = None
        self.z: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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

g.r = k
g.x = m
m.t = e
m.s = k
m.z = k
m.u = b
m.p = b
l.w = d
l.x = m
l.y = e
d.y = e
f.w = d
f.x = g
f.s = k
f.t = k
f.z = b
e.s = j
j.t = d
j.w = f
k.o = d
k.r = d
k.z = j
k.s = f
b.o = e
b.r = e
b.p = e
b.x = k
b.w = m
b.q = f
assert m.t.s.t.y.s.w.s.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: H = None
        self.u: I = None
        self.p: I = None
        self.z: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.x: A = None
        self.s: H = None
        self.t: H = None
        self.z: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: D = None
        self.z: G = None
        self.s: E = None
        self.txt = txt

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

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

g.r = k
g.x = m
m.t = e
m.s = k
m.z = k
m.u = b
m.p = b
l.w = d
l.x = m
l.y = e
d.y = e
f.w = d
f.x = g
f.s = k
f.t = k
f.z = b
e.s = j
j.t = d
j.w = f
k.o = d
k.r = d
k.z = j
k.s = f
b.o = e
b.r = e
b.p = e
b.x = k
b.w = m
b.q = f
assert m.t.s.t.y.s.w.s.txt == "k"