class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: F = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.q: E = None
        self.s: E = None
        self.z: F = None
        self.w: B = 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.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
a = D("a")
l = E("l")
n = F("n")

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

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

class C:
    def __init__(self, txt: str):
        self.y: A = None
        self.p: E = None
        self.q: E = None
        self.s: E = None
        self.z: F = None
        self.w: B = 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.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: C = None
        self.y: E = None
        self.txt = txt

g = A("g")
d = B("d")
b = C("b")
a = D("a")
l = E("l")
n = F("n")

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