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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.w: F = None
        self.v: B = None
        self.x: D = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.txt = txt

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

b.q = j
b.y = j
b.w = n
n.q = c
n.o = i
n.v = j
m.q = e
m.w = e
m.s = j
m.v = n
m.r = n
m.x = i
m.u = h
h.v = i
h.y = i
h.q = i
j.z = h
j.v = n
j.r = n
j.u = n
j.w = m
j.p = b
e.q = n
c.z = j
c.v = e
i.v = h
i.y = h
i.q = h
assert b.q.r.v.w.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.w: B = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: E = None
        self.w: F = None
        self.v: B = None
        self.x: D = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.v: F = None
        self.txt = txt

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

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