class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: F = None
        self.v: E = None
        self.u: E = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: E = None
        self.z: E = None
        self.u: F = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.w: C = None
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

g = A("g")
e = B("e")
j = C("j")
m = D("m")
h = E("h")
k = F("k")
b = C("b")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.q: F = None
        self.v: E = None
        self.z: E = None
        self.u: F = None
        self.o: B = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: D = None
        self.w: C = None
        self.x: B = None
        self.z: B = None
        self.s: D = None
        self.txt = txt

g = A("g")
e = B("e")
j = C("j")
m = D("m")
h = E("h")
k = F("k")
b = C("b")
c = F("c")

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