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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
d = C("d")
c = D("c")
b = E("b")
m = F("m")
e = G("e")

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.s: D = None
        self.o: D = None
        self.txt = txt

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

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

g = A("g")
n = B("n")
d = C("d")
c = D("c")
b = E("b")
m = F("m")
e = G("e")

g.q = n
g.w = n
g.y = n
g.x = m
g.o = e
n.v = g
d.u = e
d.x = e
d.s = m
d.o = m
d.q = c
d.w = g
d.t = b
c.t = b
b.p = g
b.s = c
b.o = c
m.q = g
m.w = g
m.x = e
m.s = e
m.y = b
e.v = g
e.y = m
e.z = c
assert g.o.y.x.z.t.s.t.txt == "b"