class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

m.x = c
m.z = c
m.v = l
m.u = n
j.z = n
j.x = i
j.q = h
n.y = l
n.z = c
n.r = i
h.z = n
b.z = h
b.y = c
b.r = l
i.w = l
i.q = h
l.p = m
c.v = j
assert j.q.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.v: G = None
        self.u: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: H = None
        self.r: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

m.x = c
m.z = c
m.v = l
m.u = n
j.z = n
j.x = i
j.q = h
n.y = l
n.z = c
n.r = i
h.z = n
b.z = h
b.y = c
b.r = l
i.w = l
i.q = h
l.p = m
c.v = j
assert j.q.z.z.txt == "c"