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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.v: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: G = None
        self.x: E = None
        self.y: C = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

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

a = A("a")
j = B("j")
g = C("g")
m = D("m")
f = E("f")
b = F("b")
k = G("k")

a.o = j
a.w = j
j.y = g
j.s = k
g.o = f
g.y = f
g.x = k
g.v = k
g.p = b
m.q = a
m.v = k
f.w = k
f.y = b
f.v = g
f.z = g
f.o = m
b.p = j
b.s = k
b.x = f
b.y = g
b.t = m
b.u = m
k.p = m
k.u = g
assert b.y.x.u.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.s: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: F = None
        self.v: C = None
        self.z: C = None
        self.o: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.s: G = None
        self.x: E = None
        self.y: C = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

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

a = A("a")
j = B("j")
g = C("g")
m = D("m")
f = E("f")
b = F("b")
k = G("k")

a.o = j
a.w = j
j.y = g
j.s = k
g.o = f
g.y = f
g.x = k
g.v = k
g.p = b
m.q = a
m.v = k
f.w = k
f.y = b
f.v = g
f.z = g
f.o = m
b.p = j
b.s = k
b.x = f
b.y = g
b.t = m
b.u = m
k.p = m
k.u = g
assert b.y.x.u.y.w.txt == "k"