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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.v: G = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.q: B = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: E = None
        self.v: G = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: B = None
        self.q: B = None
        self.s: E = None
        self.x: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.p: D = None
        self.q: F = None
        self.o: F = None
        self.txt = txt

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

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

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

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