class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.v: D = None
        self.z: C = None
        self.u: E = None
        self.o: E = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

h = A("h")
i = B("i")
b = C("b")
d = D("d")
m = E("m")
e = F("e")
g = G("g")
a = B("a")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: F = None
        self.u: E = None
        self.x: E = None
        self.txt = txt

h = A("h")
i = B("i")
b = C("b")
d = D("d")
m = E("m")
e = F("e")
g = G("g")
a = B("a")

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