class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.y: B = None
        self.x: E = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.q: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

e.o = f
e.q = f
e.r = k
e.w = g
f.u = e
f.o = k
g.o = e
g.u = n
g.y = f
g.r = f
g.v = f
g.x = b
n.u = d
n.p = b
n.q = f
n.t = g
n.y = g
b.r = f
b.o = f
b.u = g
b.x = n
d.o = g
d.w = e
k.o = b
k.v = f
assert f.u.w.o.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.r: G = None
        self.w: C = None
        self.q: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.u: D = None
        self.y: B = None
        self.x: E = None
        self.r: B = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: E = None
        self.q: B = None
        self.t: C = None
        self.y: C = None
        self.txt = txt

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

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

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

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

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