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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.u: A = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: E = None
        self.p: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.t: C = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.r: A = None
        self.u: A = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.o: E = None
        self.p: C = None
        self.txt = txt

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

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