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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.s: B = None
        self.r: A = None
        self.u: C = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.s: B = None
        self.r: A = None
        self.u: C = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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