class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: G = None
        self.u: C = None
        self.x: C = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: A = None
        self.y: A = None
        self.o: D = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.v: B = None
        self.r: B = None
        self.y: F = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

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

h.r = n
h.v = k
h.u = j
h.x = j
h.y = l
h.p = i
m.w = i
m.s = l
m.y = j
j.q = d
i.x = k
i.q = m
i.s = n
l.z = h
n.t = j
n.u = d
n.y = h
n.o = i
n.z = i
n.w = m
k.o = m
k.v = m
k.r = m
k.p = m
k.z = j
k.y = n
k.x = l
d.r = n
d.v = k
d.u = j
d.x = j
d.y = c
d.p = i
c.z = d
assert h.r.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: G = None
        self.u: C = None
        self.x: C = None
        self.y: E = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: D = None
        self.s: E = None
        self.y: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: A = None
        self.y: A = None
        self.o: D = None
        self.w: B = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.v: B = None
        self.r: B = None
        self.y: F = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

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

h.r = n
h.v = k
h.u = j
h.x = j
h.y = l
h.p = i
m.w = i
m.s = l
m.y = j
j.q = d
i.x = k
i.q = m
i.s = n
l.z = h
n.t = j
n.u = d
n.y = h
n.o = i
n.z = i
n.w = m
k.o = m
k.v = m
k.r = m
k.p = m
k.z = j
k.y = n
k.x = l
d.r = n
d.v = k
d.u = j
d.x = j
d.y = c
d.p = i
c.z = d
assert h.r.w.y.txt == "j"