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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.v: A = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.o: B = None
        self.q: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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

b.o = h
b.z = i
i.q = h
i.w = h
i.y = a
i.t = a
i.v = b
n.o = h
l.r = c
j.x = l
j.s = l
j.y = l
j.o = a
j.q = a
c.r = b
c.u = l
h.v = j
h.z = j
h.w = m
h.x = i
h.r = l
m.x = l
m.s = l
m.y = l
m.o = i
m.q = a
a.q = h
a.w = h
a.y = i
a.t = i
a.v = b
assert h.z.y.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: B = None
        self.v: A = None
        self.w: G = None
        self.t: B = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.s: D = None
        self.o: B = None
        self.q: B = None
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: A = None
        self.u: D = None
        self.txt = txt

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

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

b.o = h
b.z = i
i.q = h
i.w = h
i.y = a
i.t = a
i.v = b
n.o = h
l.r = c
j.x = l
j.s = l
j.y = l
j.o = a
j.q = a
c.r = b
c.u = l
h.v = j
h.z = j
h.w = m
h.x = i
h.r = l
m.x = l
m.s = l
m.y = l
m.o = i
m.q = a
a.q = h
a.w = h
a.y = i
a.t = i
a.v = b
assert h.z.y.r.u.txt == "l"