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

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.p: D = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.p: D = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

j.r = h
c.q = e
c.x = e
c.u = j
c.p = m
c.v = m
h.q = e
m.y = n
m.v = e
m.z = l
l.u = n
l.r = n
l.t = h
l.q = m
e.q = m
e.r = d
e.z = l
d.q = l
d.v = j
d.t = j
d.y = j
d.p = m
d.z = m
n.u = e
n.t = e
n.p = m
assert c.u.r.q.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: A = None
        self.p: D = None
        self.x: F = None
        self.v: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: A = None
        self.t: A = None
        self.p: D = None
        self.z: D = None
        self.y: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

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

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