class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.z: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.x: B = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.y: G = None
        self.txt = txt

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

f = A("f")
j = B("j")
d = C("d")
n = D("n")
l = E("l")
a = F("a")
k = G("k")

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.r: A = None
        self.z: B = None
        self.q: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: B = None
        self.x: B = None
        self.q: B = None
        self.z: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.y: G = None
        self.txt = txt

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

f = A("f")
j = B("j")
d = C("d")
n = D("n")
l = E("l")
a = F("a")
k = G("k")

f.o = j
f.r = j
f.w = n
f.v = a
j.z = l
d.p = j
d.z = j
d.r = f
d.q = k
n.s = f
n.z = f
n.r = j
n.x = j
n.q = j
l.o = n
l.p = j
l.t = k
a.o = j
a.u = j
a.y = k
k.v = d
k.s = n
k.r = l
assert a.u.z.o.s.o.txt == "j"