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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

c.y = f
c.z = n
l.z = h
l.t = h
n.z = d
n.y = i
n.v = a
d.y = a
d.q = n
d.r = n
d.x = f
d.s = l
f.z = a
f.u = h
a.q = c
a.p = c
a.y = h
i.x = d
i.r = d
i.p = h
h.y = f
h.z = n
assert l.z.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

c.y = f
c.z = n
l.z = h
l.t = h
n.z = d
n.y = i
n.v = a
d.y = a
d.q = n
d.r = n
d.x = f
d.s = l
f.z = a
f.u = h
a.q = c
a.p = c
a.y = h
i.x = d
i.r = d
i.p = h
h.y = f
h.z = n
assert l.z.z.v.txt == "a"