class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: F = None
        self.x: D = None
        self.s: A = None
        self.o: B = None
        self.u: F = 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.z: D = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: B = None
        self.s: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.txt = txt

b = A("b")
a = B("a")
m = C("m")
d = D("d")
n = E("n")
i = F("i")
g = A("g")
f = E("f")

b.q = a
b.o = a
b.v = i
b.u = i
b.x = d
b.s = g
a.v = g
m.z = d
m.q = i
m.v = i
d.x = m
d.u = m
d.w = a
d.p = a
d.s = b
n.r = f
n.v = f
i.p = a
i.w = d
g.q = a
g.o = a
g.v = i
g.u = i
g.x = d
g.s = b
f.r = n
f.v = n
assert b.x.s.u.p.v.s.o.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.v: F = None
        self.x: D = None
        self.s: A = None
        self.o: B = None
        self.u: F = 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.z: D = None
        self.q: F = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.w: B = None
        self.p: B = None
        self.s: A = None
        self.u: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.w: D = None
        self.txt = txt

b = A("b")
a = B("a")
m = C("m")
d = D("d")
n = E("n")
i = F("i")
g = A("g")
f = E("f")

b.q = a
b.o = a
b.v = i
b.u = i
b.x = d
b.s = g
a.v = g
m.z = d
m.q = i
m.v = i
d.x = m
d.u = m
d.w = a
d.p = a
d.s = b
n.r = f
n.v = f
i.p = a
i.w = d
g.q = a
g.o = a
g.v = i
g.u = i
g.x = d
g.s = b
f.r = n
f.v = n
assert b.x.s.u.p.v.s.o.v.txt == "g"