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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.s: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

c = A("c")
d = B("d")
n = C("n")
l = D("l")
b = E("b")
k = F("k")
h = G("h")
j = H("j")
a = C("a")

c.w = b
d.q = c
d.v = l
d.w = a
d.z = h
d.u = h
n.o = d
n.s = d
n.x = b
n.y = h
l.q = h
l.o = a
b.y = k
k.v = j
k.y = j
k.u = d
h.y = a
j.x = c
a.o = d
a.s = d
a.x = b
a.y = h
assert c.w.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.s: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

c = A("c")
d = B("d")
n = C("n")
l = D("l")
b = E("b")
k = F("k")
h = G("h")
j = H("j")
a = C("a")

c.w = b
d.q = c
d.v = l
d.w = a
d.z = h
d.u = h
n.o = d
n.s = d
n.x = b
n.y = h
l.q = h
l.o = a
b.y = k
k.v = j
k.y = j
k.u = d
h.y = a
j.x = c
a.o = d
a.s = d
a.x = b
a.y = h
assert c.w.y.v.txt == "j"