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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.y: C = None
        self.o: A = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: G = None
        self.y: C = None
        self.o: A = None
        self.w: D = None
        self.z: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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