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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: B = None
        self.txt = txt

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

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