class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.u: E = None
        self.o: E = None
        self.v: F = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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