class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.w: D = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: D = None
        self.t: D = None
        self.q: B = None
        self.txt = txt

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

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

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