class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: D = None
        self.x: B = None
        self.o: E = None
        self.q: G = None
        self.v: D = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

c.s = g
c.u = f
c.v = f
c.x = k
c.w = k
c.o = b
c.q = m
k.y = f
k.v = f
k.z = m
k.t = d
k.o = b
l.x = b
f.o = d
f.q = c
b.o = f
d.r = b
d.t = b
d.s = c
g.r = d
g.o = c
g.q = c
g.y = f
g.w = f
g.u = n
m.r = d
m.o = c
m.q = c
m.y = f
m.w = f
m.u = l
n.x = b
assert k.v.q.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: D = None
        self.x: B = None
        self.o: E = None
        self.q: G = None
        self.v: D = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.z: G = None
        self.v: D = None
        self.t: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

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

c.s = g
c.u = f
c.v = f
c.x = k
c.w = k
c.o = b
c.q = m
k.y = f
k.v = f
k.z = m
k.t = d
k.o = b
l.x = b
f.o = d
f.q = c
b.o = f
d.r = b
d.t = b
d.s = c
g.r = d
g.o = c
g.q = c
g.y = f
g.w = f
g.u = n
m.r = d
m.o = c
m.q = c
m.y = f
m.w = f
m.u = l
n.x = b
assert k.v.q.v.txt == "f"