class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: D = None
        self.v: H = None
        self.u: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.v: B = None
        self.y: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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

j = A("j")
g = B("g")
n = C("n")
e = D("e")
c = E("c")
b = F("b")
k = G("k")
l = H("l")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.s: E = None
        self.v: B = None
        self.y: G = None
        self.o: F = None
        self.txt = txt

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

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

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

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

j = A("j")
g = B("g")
n = C("n")
e = D("e")
c = E("c")
b = F("b")
k = G("k")
l = H("l")

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