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

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

h.y = k
h.s = d
h.t = l
l.u = k
l.r = k
l.x = f
e.u = l
e.p = c
e.y = d
c.r = e
k.u = e
k.v = h
f.s = l
f.q = k
f.r = c
d.y = f
d.t = e
d.x = e
d.v = h
d.p = k
assert h.t.u.v.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: G = None
        self.t: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: E = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

h.y = k
h.s = d
h.t = l
l.u = k
l.r = k
l.x = f
e.u = l
e.p = c
e.y = d
c.r = e
k.u = e
k.v = h
f.s = l
f.q = k
f.r = c
d.y = f
d.t = e
d.x = e
d.v = h
d.p = k
assert h.t.u.v.s.p.txt == "k"