class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: D = None
        self.y: F = None
        self.p: B = None
        self.q: B = None
        self.s: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.x: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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