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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
j = B("j")
a = C("a")
f = D("f")
l = E("l")
g = F("g")
b = G("b")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

e = A("e")
j = B("j")
a = C("a")
f = D("f")
l = E("l")
g = F("g")
b = G("b")
d = F("d")

e.w = j
j.s = d
a.t = j
a.x = j
a.u = e
a.w = g
a.q = f
a.o = f
f.o = b
f.w = j
l.p = b
l.v = e
l.s = a
g.s = a
g.w = j
g.x = f
g.p = f
b.o = g
d.s = a
d.w = j
d.x = f
d.p = f
assert a.u.w.s.x.txt == "f"