class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: F = None
        self.p: F = None
        self.q: F = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.v: A = None
        self.w: F = None
        self.u: B = None
        self.y: G = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
l = C("l")
c = D("c")
a = E("a")
k = F("k")
h = G("h")

n.y = d
n.v = d
n.z = k
n.p = k
n.q = k
n.x = h
d.y = a
d.r = c
l.q = k
l.o = k
l.s = d
c.o = h
c.y = h
c.q = k
c.w = k
c.v = n
c.u = d
a.s = h
a.z = k
k.y = d
h.u = d
h.q = a
h.z = a
assert a.z.y.y.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: F = None
        self.p: F = None
        self.q: F = None
        self.v: B = None
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: F = None
        self.v: A = None
        self.w: F = None
        self.u: B = None
        self.y: G = None
        self.txt = txt

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

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

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

n = A("n")
d = B("d")
l = C("l")
c = D("c")
a = E("a")
k = F("k")
h = G("h")

n.y = d
n.v = d
n.z = k
n.p = k
n.q = k
n.x = h
d.y = a
d.r = c
l.q = k
l.o = k
l.s = d
c.o = h
c.y = h
c.q = k
c.w = k
c.v = n
c.u = d
a.s = h
a.z = k
k.y = d
h.u = d
h.q = a
h.z = a
assert a.z.y.y.s.u.txt == "d"