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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: B = None
        self.txt = txt

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

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