class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: E = None
        self.x: E = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.v: A = None
        self.y: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: F = None
        self.v: A = None
        self.y: G = None
        self.s: A = None
        self.txt = txt

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

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

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

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

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

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