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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.r: B = None
        self.t: D = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.y: A = None
        self.w: B = None
        self.p: C = None
        self.r: E = None
        self.txt = txt

d = A("d")
i = B("i")
e = C("e")
m = D("m")
f = E("f")
b = F("b")
n = G("n")
k = D("k")

d.w = n
i.o = d
e.w = f
e.y = i
m.q = i
m.r = i
m.w = i
m.x = d
m.o = n
m.u = n
f.r = n
b.y = n
b.w = e
b.p = e
b.r = i
b.t = k
n.s = i
n.w = i
n.t = m
n.y = d
n.p = e
n.r = f
k.q = i
k.r = i
k.w = i
k.x = d
k.o = n
k.u = n
assert f.r.w.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.w: C = None
        self.r: B = None
        self.t: D = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.y: A = None
        self.w: B = None
        self.p: C = None
        self.r: E = None
        self.txt = txt

d = A("d")
i = B("i")
e = C("e")
m = D("m")
f = E("f")
b = F("b")
n = G("n")
k = D("k")

d.w = n
i.o = d
e.w = f
e.y = i
m.q = i
m.r = i
m.w = i
m.x = d
m.o = n
m.u = n
f.r = n
b.y = n
b.w = e
b.p = e
b.r = i
b.t = k
n.s = i
n.w = i
n.t = m
n.y = d
n.p = e
n.r = f
k.q = i
k.r = i
k.w = i
k.x = d
k.o = n
k.u = n
assert f.r.w.o.w.p.txt == "e"