class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.q: C = None
        self.t: C = None
        self.y: F = None
        self.o: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

c.v = n
c.y = n
c.x = m
c.q = l
c.t = l
c.o = j
m.v = l
m.r = c
l.u = m
f.q = k
f.v = j
h.w = c
h.x = n
n.x = j
k.t = h
j.y = m
assert f.q.t.w.t.u.r.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.x: B = None
        self.q: C = None
        self.t: C = None
        self.y: F = None
        self.o: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

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

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

c.v = n
c.y = n
c.x = m
c.q = l
c.t = l
c.o = j
m.v = l
m.r = c
l.u = m
f.q = k
f.v = j
h.w = c
h.x = n
n.x = j
k.t = h
j.y = m
assert f.q.t.w.t.u.r.q.u.txt == "m"