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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.t: G = None
        self.s: G = None
        self.q: G = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.s: G = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.r: E = None
        self.t: G = None
        self.s: G = None
        self.q: G = None
        self.u: F = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: A = None
        self.s: G = None
        self.x: B = None
        self.p: B = None
        self.txt = txt

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

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

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

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