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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.o: G = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.q: C = None
        self.p: B = None
        self.x: G = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: B = None
        self.o: G = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: B = None
        self.q: C = None
        self.p: B = None
        self.x: G = None
        self.u: C = None
        self.z: F = None
        self.txt = txt

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

g.t = d
g.p = n
b.s = i
b.t = i
b.r = i
i.o = b
n.s = l
n.w = g
d.s = g
h.z = i
h.q = b
h.o = l
h.x = n
h.p = g
m.t = d
m.s = b
m.p = b
m.q = i
m.u = i
m.x = l
m.z = h
l.t = d
l.s = b
l.p = b
l.q = i
l.u = i
l.x = m
l.z = h
assert i.o.r.o.txt == "b"