class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: D = None
        self.u: C = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.z: G = None
        self.x: G = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.r: B = None
        self.q: E = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.x: E = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
c = D("c")
l = E("l")
i = F("i")
a = G("a")
e = E("e")
h = F("h")

m.w = l
m.p = f
m.x = c
m.u = n
m.v = a
f.q = c
n.p = c
n.r = c
n.t = e
n.z = a
n.x = a
c.p = n
c.x = f
l.o = e
l.x = c
l.t = a
l.p = n
l.u = n
i.x = f
i.r = f
i.y = e
i.q = l
i.z = a
i.w = h
a.p = c
a.q = h
a.x = l
e.o = l
e.x = c
e.t = a
e.p = n
e.u = n
h.x = f
h.r = f
h.y = e
h.q = e
h.z = a
h.w = i
assert f.q.x.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.p: B = None
        self.x: D = None
        self.u: C = None
        self.v: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.t: E = None
        self.z: G = None
        self.x: G = None
        self.r: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: E = None
        self.r: B = None
        self.q: E = None
        self.z: G = None
        self.w: F = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: F = None
        self.x: E = None
        self.txt = txt

m = A("m")
f = B("f")
n = C("n")
c = D("c")
l = E("l")
i = F("i")
a = G("a")
e = E("e")
h = F("h")

m.w = l
m.p = f
m.x = c
m.u = n
m.v = a
f.q = c
n.p = c
n.r = c
n.t = e
n.z = a
n.x = a
c.p = n
c.x = f
l.o = e
l.x = c
l.t = a
l.p = n
l.u = n
i.x = f
i.r = f
i.y = e
i.q = l
i.z = a
i.w = h
a.p = c
a.q = h
a.x = l
e.o = l
e.x = c
e.t = a
e.p = n
e.u = n
h.x = f
h.r = f
h.y = e
h.q = e
h.z = a
h.w = i
assert f.q.x.q.x.txt == "f"