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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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