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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.y: E = None
        self.v: B = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
c = D("c")
e = E("e")
g = F("g")
f = G("f")
a = D("a")
k = A("k")

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: F = None
        self.x: A = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.y: E = None
        self.v: B = None
        self.txt = txt

l = A("l")
b = B("b")
n = C("n")
c = D("c")
e = E("e")
g = F("g")
f = G("f")
a = D("a")
k = A("k")

l.x = g
l.o = a
b.p = f
b.y = f
b.r = f
b.q = k
b.t = l
n.w = g
n.r = g
n.x = l
n.o = c
c.w = a
e.p = l
e.y = l
e.o = f
g.w = f
g.s = k
g.u = b
f.q = g
f.p = l
f.y = e
f.v = b
a.w = c
k.x = g
k.o = c
assert n.w.s.x.w.q.txt == "g"