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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.t: C = None
        self.y: C = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.s: B = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

k = A("k")
f = B("f")
l = C("l")
j = D("j")
h = E("h")
m = F("m")
d = G("d")
i = G("i")

k.s = i
k.x = i
k.r = f
f.r = j
f.t = h
f.w = h
f.y = m
l.x = f
j.o = l
j.v = h
h.u = d
h.x = m
h.t = l
h.y = l
h.p = j
h.w = k
m.o = k
d.y = m
d.o = m
d.v = h
d.s = f
d.t = k
i.y = m
i.o = m
i.v = h
i.s = f
i.t = k
assert d.t.r.t.x.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.r: B = None
        self.x: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.y: F = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.v: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: F = None
        self.t: C = None
        self.y: C = None
        self.p: D = None
        self.w: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.y: F = None
        self.v: E = None
        self.s: B = None
        self.o: F = None
        self.t: A = None
        self.txt = txt

k = A("k")
f = B("f")
l = C("l")
j = D("j")
h = E("h")
m = F("m")
d = G("d")
i = G("i")

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