class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.z: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

h.y = g
h.z = g
h.v = d
a.t = f
a.z = h
b.v = f
d.r = f
d.u = g
d.w = m
d.y = b
d.v = h
d.q = n
g.t = d
g.s = h
n.u = b
f.p = n
f.v = n
f.r = n
f.z = b
f.y = g
l.t = f
l.z = h
m.r = f
m.u = g
m.w = d
m.y = b
m.v = h
m.q = n
assert h.v.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.v: D = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: F = None
        self.z: C = None
        self.y: E = None
        self.r: F = None
        self.txt = txt

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

h.y = g
h.z = g
h.v = d
a.t = f
a.z = h
b.v = f
d.r = f
d.u = g
d.w = m
d.y = b
d.v = h
d.q = n
g.t = d
g.s = h
n.u = b
f.p = n
f.v = n
f.r = n
f.z = b
f.y = g
l.t = f
l.z = h
m.r = f
m.u = g
m.w = d
m.y = b
m.v = h
m.q = n
assert h.v.q.u.txt == "b"