class A:
    def __init__(self, txt: str):
        self.z: B = None
        self.u: B = None
        self.w: C = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: 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.q: E = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: 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.q: E = None
        self.s: D = None
        self.txt = txt

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

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