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

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.v: F = None
        self.y: F = None
        self.p: G = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.w: F = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
c = C("c")
l = D("l")
m = E("m")
e = F("e")
b = G("b")

h.o = e
h.x = e
h.w = e
h.z = m
d.v = b
c.y = b
c.u = h
c.r = m
l.r = h
l.x = h
l.w = h
l.s = h
l.v = e
l.y = e
l.p = b
m.x = h
m.r = b
m.s = b
m.w = e
m.o = e
e.w = b
e.z = b
e.q = d
b.x = e
assert m.x.w.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: E = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.x: A = None
        self.v: F = None
        self.y: F = None
        self.p: G = None
        self.w: A = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: G = None
        self.w: F = None
        self.o: F = None
        self.s: G = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
c = C("c")
l = D("l")
m = E("m")
e = F("e")
b = G("b")

h.o = e
h.x = e
h.w = e
h.z = m
d.v = b
c.y = b
c.u = h
c.r = m
l.r = h
l.x = h
l.w = h
l.s = h
l.v = e
l.y = e
l.p = b
m.x = h
m.r = b
m.s = b
m.w = e
m.o = e
e.w = b
e.z = b
e.q = d
b.x = e
assert m.x.w.q.v.txt == "b"