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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.s: B = None
        self.q: F = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.z: F = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

f.y = m
f.r = h
m.p = h
m.o = n
i.t = m
i.s = m
i.x = n
i.q = h
i.u = f
i.w = j
j.y = m
j.s = m
j.o = l
j.z = h
e.u = m
h.z = n
h.s = e
l.s = h
l.x = e
l.y = e
l.z = f
l.o = f
l.r = j
n.t = m
n.s = m
n.x = i
n.q = h
n.u = f
n.w = j
assert j.y.p.z.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.r: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.o: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.x: C = None
        self.s: B = None
        self.q: F = None
        self.u: A = None
        self.w: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: G = None
        self.z: F = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

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

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

f.y = m
f.r = h
m.p = h
m.o = n
i.t = m
i.s = m
i.x = n
i.q = h
i.u = f
i.w = j
j.y = m
j.s = m
j.o = l
j.z = h
e.u = m
h.z = n
h.s = e
l.s = h
l.x = e
l.y = e
l.z = f
l.o = f
l.r = j
n.t = m
n.s = m
n.x = i
n.q = h
n.u = f
n.w = j
assert j.y.p.z.x.txt == "i"